home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / sync / syncStat.c < prev    next >
C/C++ Source or Header  |  1990-10-05  |  2KB  |  69 lines

  1. /* 
  2.  * syncStat.c --
  3.  *
  4.  *    Keep and print statistics for the sync module.
  5.  *
  6.  * Copyright (C) 1985 Regents of the University of California
  7.  * All rights reserved.
  8.  */
  9.  
  10. #ifndef lint
  11. static char rcsid[] = "$Header: /sprite/src/kernel/sync/RCS/syncStat.c,v 9.1 90/10/05 17:50:31 mendel Exp $ SPRITE (Berkeley)";
  12. #endif /* not lint */
  13.  
  14.  
  15. #include <sprite.h>
  16. #include <sync.h>
  17. #include <stdio.h>
  18. #include <bstring.h>
  19.  
  20.  
  21. /*
  22.  *----------------------------------------------------------------------
  23.  *
  24.  * Sync_PrintStat --
  25.  *
  26.  *    Print the sync module statistics.
  27.  *
  28.  * Results:
  29.  *    None.
  30.  *
  31.  * Side effects:
  32.  *    Do the prints.
  33.  *
  34.  *----------------------------------------------------------------------
  35.  */
  36. void
  37. Sync_PrintStat()
  38. {
  39.     int     i;
  40.     int        total;
  41.  
  42.     printf("Sync Statistics\n");
  43.     total = 0;
  44.     for (i = 0; i < mach_NumProcessors; i++) {
  45.     total += sync_Instrument[i].numWakeups;
  46.     }
  47.     printf("numWakeups = %d\n", total);
  48.     total = 0;
  49.     for (i = 0; i < mach_NumProcessors; i++) {
  50.     total += sync_Instrument[i].numWakeupCalls;
  51.     }
  52.     printf("numWakeupCalls = %d\n", total);
  53.     total = 0;
  54.     for (i = 0; i < mach_NumProcessors; i++) {
  55.     total += sync_Instrument[i].numSpuriousWakeups;
  56.     }
  57.     printf("numSpuriousWakeups = %d\n", total);
  58.     total = 0;
  59.     for (i = 0; i < mach_NumProcessors; i++) {
  60.     total += sync_Instrument[i].numLocks;
  61.     }
  62.     printf("numLocks = %d\n", total);
  63.     total = 0;
  64.     for (i = 0; i < mach_NumProcessors; i++) {
  65.     total += sync_Instrument[i].numUnlocks;
  66.     }
  67.     printf("numUnlocks = %d\n", total);
  68. }
  69.